import request from "../utils/request";
const api_name = "/order";

export default {
    // 获取课程购买状态
    isBought(courseId) {
        return request({
            url: `${api_name}/isbought/${courseId}`,
            method: "get",
        });
    },
    // 获取指定课程的订单信息
    showInfo(courseId) {
        return request({
            url: `http://39.98.120.230:8080/api/order/info/${courseId}`,
            method: "get",
        });
    },
    createOrder(courseId) {
        return request({
            url: `http://39.98.120.230:8080/api/order/${courseId}`,
            method: "post",
        });
    },
    //获取用户的所有列表
    getOrders() {
        return request({
            url: `http://39.98.120.230:8080/api/order/list`,
            methodL: "get",
        });
    },
};